function func(deviceData) {
    deviceData.name = 'yyy';
    return deviceData;
}

function funct(str) {
    const data = JSON.parse(str);
    if (data && typeof data === 'object') {
        const {reported} = data;
        const params = [];
        _.map(reported, (value, name) => {
            params.push({name, value});
        });
        return params;
    }
}
